package com.example.mapper;

import com.example.pojo.RegisterMsg;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;

@Mapper
public interface RegisterMapper {
    @Insert("insert into students(username,password,name,student_id,class_id) values(#{username},#{password},#{name},#{studentId},(select class_id from classes where class_name=#{className}))")
    void registerStudent(RegisterMsg registerMsg);

    @Insert("insert into teachers(username,password,name,teacher_id) values(#{username},#{password},#{name},#{teacherId})")
    void registerTeacher(RegisterMsg registerMsg);
}
